module denqueueUpdateMuxer8 (
    input wire clk,
    input wire rst,
    input wire dequeue_head_new_en_1,
    input wire dequeue_head_new_en_2,
    input wire dequeue_head_new_en_3,
    input wire dequeue_head_new_en_4,
    input wire dequeue_head_new_en_5,
    input wire dequeue_head_new_en_6,
    input wire dequeue_head_new_en_7,
    input wire dequeue_head_new_en_8,
    input wire [5:0] dequeue_head_new_priority_1,
    input wire [5:0] dequeue_head_new_priority_2,
    input wire [5:0] dequeue_head_new_priority_3,
    input wire [5:0] dequeue_head_new_priority_4,
    input wire [5:0] dequeue_head_new_priority_5,
    input wire [5:0] dequeue_head_new_priority_6,
    input wire [5:0] dequeue_head_new_priority_7,
    input wire [5:0] dequeue_head_new_priority_8,
    input wire [15:0]  dequeue_head_new_value_1,
    input wire [15:0]  dequeue_head_new_value_2,
    input wire [15:0]  dequeue_head_new_value_3,
    input wire [15:0]  dequeue_head_new_value_4,
    input wire [15:0]  dequeue_head_new_value_5,
    input wire [15:0]  dequeue_head_new_value_6,
    input wire [15:0]  dequeue_head_new_value_7,
    input wire [15:0]  dequeue_head_new_value_8,
    output wire [7:0] enqueue_arbitration,
    output reg dequeue_head_new_en,
    output reg [5:0] dequeue_head_new_priority,
    output reg [15:0]  dequeue_head_new_value
);
    always @(posedge clk) begin
        //将输出信号进行复位
        if (rst) begin
            dequeue_head_new_en <= 1'b0;
            dequeue_head_new_priority <= 0;
        end

        if (enqueue_arbitration == 8'b00000001) begin
            dequeue_head_new_en <= 1'b1;
            dequeue_head_new_priority <= dequeue_head_new_priority_1;
            dequeue_head_new_value <= dequeue_head_new_value_1;
        end

        if (enqueue_arbitration == 8'b00000010) begin
            dequeue_head_new_en <= 1'b1;
            dequeue_head_new_priority <= dequeue_head_new_priority_2;
            dequeue_head_new_value <= dequeue_head_new_value_2;
        end

        if (enqueue_arbitration == 8'b00000100) begin
            dequeue_head_new_en <= 1'b1;
            dequeue_head_new_priority <= dequeue_head_new_priority_3;
            dequeue_head_new_value <= dequeue_head_new_value_3;
        end

        if (enqueue_arbitration == 8'b00001000) begin
            dequeue_head_new_en <= 1'b1;
            dequeue_head_new_priority <= dequeue_head_new_priority_4;
            dequeue_head_new_value <= dequeue_head_new_value_4;
        end

        if (enqueue_arbitration == 8'b00010000) begin
            dequeue_head_new_en <= 1'b1;
            dequeue_head_new_priority <= dequeue_head_new_priority_5;
            dequeue_head_new_value <= dequeue_head_new_value_5;
        end

        if (enqueue_arbitration == 8'b00100000) begin
            dequeue_head_new_en <= 1'b1;
            dequeue_head_new_priority <= dequeue_head_new_priority_6;
            dequeue_head_new_value <= dequeue_head_new_value_6;
        end

        if (enqueue_arbitration == 8'b01000000) begin
            dequeue_head_new_en <= 1'b1;
            dequeue_head_new_priority <= dequeue_head_new_priority_7;
            dequeue_head_new_value <= dequeue_head_new_value_7;
        end

        if (enqueue_arbitration == 8'b10000000) begin
            dequeue_head_new_en <= 1'b1;
            dequeue_head_new_priority <= dequeue_head_new_priority_8;
            dequeue_head_new_value <= dequeue_head_new_value_8;
        end

        if (enqueue_arbitration == 8'b00000000) begin
            dequeue_head_new_en <= 1'b0;
        end
    end
    
    denqueueUpdateArbiter8 arb(.dequeue_head_new_en_1(dequeue_head_new_en_1), .dequeue_head_new_en_2(dequeue_head_new_en_2), .dequeue_head_new_en_3(dequeue_head_new_en_3), .dequeue_head_new_en_4(dequeue_head_new_en_4), .dequeue_head_new_en_5(dequeue_head_new_en_5), .dequeue_head_new_en_6(dequeue_head_new_en_6), .dequeue_head_new_en_7(dequeue_head_new_en_7), .dequeue_head_new_en_8(dequeue_head_new_en_8), 
                            .dequeue_head_new_priority_1(dequeue_head_new_priority_1), .dequeue_head_new_priority_2(dequeue_head_new_priority_2), .dequeue_head_new_priority_3(dequeue_head_new_priority_3), .dequeue_head_new_priority_4(dequeue_head_new_priority_4), .dequeue_head_new_priority_5(dequeue_head_new_priority_5), .dequeue_head_new_priority_6(dequeue_head_new_priority_6), .dequeue_head_new_priority_7(dequeue_head_new_priority_7), .dequeue_head_new_priority_8(dequeue_head_new_priority_8), .queue_arbitration(enqueue_arbitration));
endmodule